/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.orm.refinedclasses;

import org.testis.orm.classes.T_bed_firmware;

/**
 * 
 * @author selcuk
 */
public class DeviceFirmwareRefined extends TestBedItem {

    private T_bed_firmware m_reference;

    public DeviceFirmwareRefined(T_bed_firmware reference) {
	super();
	setReference(reference);
    }

    public int getId() {
	return m_reference.getId();
    }

    public String getDescription() {
	String result = m_reference.getDescription();
	if (result == null) {
	    result = "";
	}
	return result;
    }

    public String getName() {
	String result = m_reference.getName();
	if (result == null) {
	    result = "";
	}
	return result;
    }

    @Override
    public String toString() {
	StringBuilder sb = new StringBuilder(getName());
	String desc = getDescription();
	if (desc.length() > 0) {
	    sb.append(" - " + desc);
	}
	return sb.toString();
    }

    @Override
    public String getTypeName() {
	return "DeviceFirmware";
    }

    private void setReference(T_bed_firmware reference) {
	if (reference == null) {
	    throw new NullPointerException();
	}
	m_reference = reference;
    }
}
